#!/usr/bin/perl
$name = "nguyen ngoc oanh";
# /^ bat dau tu dau chuoi
print "grep " if $name=~/Oanh/;
print "grep i\n" if $name=~/Oanh/i;

print "grep 1\n" if $name=~/nguyen ngoc oan/i;
print "grep 2\n" if $name=~/^nguyen ngoc oan$/i;
print "grep 2\n" if $name=~/^nguyen ngoc oan/i;

# ? 0 hoac 1 lan, + >= 1 lan, * >=0 lan

# thay the  /g de thay the tat ca , chu y =~ ko phai = ~
$name = "nguyen ngoc oanh nguyen ngoc oanh";
$name =~ s/oanh/oanhcho/;
print "\n$name\n";

$name = "nguyen ngoc oanh nguyen ngoc oanh";
$name =~ s/oanh/oanhcho/g;
print "\n$name\n";

